package com.suxin.rule.abstrct;

import com.suxin.rule.dto.RuleDTO;

/**
 * @author Tang
 * @classname AbstractRule
 * @description [ 规则模板 ]
 * @date 2022/1/9 19:08
 */
public abstract class AbstractRule implements BaseRule{

    protected <T> T convert(RuleDTO ruleDTO) {
        return (T) ruleDTO;
    }

    @Override
    public boolean execute(RuleDTO ruleDTO) {
        return executeRule(convert(ruleDTO));
    }

    protected <T> boolean executeRule(T t){
        return true;
    }
}